'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.

const path = require('path')

module.exports = {
  devServer: {
    disableHostCheck: true,
    // port: 8085, // 端口号
    host: '0.0.0.0',
    // https: false, // https:{type:Boolean}
    open: true, //配置自动启动浏览器
    proxy: { // 配置跨域,index.php代表访问的api名字，如http://localhost/index.php?data=123
      '/api': {
        target: 'http://api.test.com:8080',
        secure: true, // 如果是https接口，需要配置这个参数
        changOrigin: true, // 如果接口跨域，需要进行这个参数配置
        pathRewrite: {
          '^api': '/api'
        }
      }
    },
  },
  css: {
    loaderOptions: {
      sass: {
        data: `@import "@/init/theme.scss";`
      },
      postcss: {
        plugins: [
          require('postcss-pxtorem')({
            rootValue: 32, // 换算的基数
            propList: ['*'],
          }),
        ]
      }
    }
  },
  publicPath: process.env.NODE_ENV === 'production' ? '/dist' : '/'
}
